#include<stdio.h>
int New(int x)
{
	int add = 0;
	while(x!=0)
	{
		add =add +x%10;
		x = x/10;
	}
	return add*3+1;
}

int main()
{
	int N=0;
	int N_0=0;
	int cnt = 1;
	scanf("%d",&N);
	while(N!=N_0)
	{
		N_0=N;
		N=New(N);
		printf("%d:%d\n",cnt,N);
		cnt++;
		
	}
	return 0;
}
